/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package searchers;

import java.util.Vector;
import model.Product;
import model.Recipe;

/**
 *
 * @author zimi
 */
public class DietSearcher implements Searcher {

    private Vector/*<Product>*/ products = new Vector();

    public boolean isHit(Recipe recipe) {
        Vector ingredients = recipe.getIngredients();
        for(int i = 0; i < products.size(); i++) {
            Product product = (Product)products.elementAt(i);
            if(!recipe.containsProduct(product)) {
                return false;
            }
        }
        return true;
    }

    public void addProduct(Product product) {
        products.addElement(product);
    }

}
